<template>
    <Dropdown trigger="custom" :visible="props.visible" style="margin-left: 20px">
        <template #list>
            <DropdownMenu>
                <DropdownItem> 
                    <span @click="removeFlowNode">删除节点</span>
                </DropdownItem>
                <DropdownItem @click="editFlowNode">编辑节点</DropdownItem>
            </DropdownMenu>
        </template>
    </Dropdown>
</template>

<script lang="js" name="Dropdown" setup>
const props = defineProps({
    visible: {
        type: Boolean,
        default: false
    },
    options: {
        type: Object,
        default: {
            left: 0,
            top: 0
        }
    }
})
const emit = defineEmits(['on-remove-node', 'on-edit-node'])
const removeFlowNode = () => {
    emit('on-remove-node')
}
const editFlowNode = () => {
    emit('on-edit-node')
}
</script>